package com.ahzx.department.service.impl;

import com.ahzx.department.domain.Department;
import com.ahzx.department.mapper.DepartmentMapper;
import com.ahzx.department.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 归属部门业务实现类
 * @Author syg
 * @Date 2021/4/30 8:50
 * @Desc To be or not to be,that is a question.
 */
@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<Department> selectDepartmentList() {
        return departmentMapper.selectDepartmentList();
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void insertDepartment() {
        departmentMapper.insertDepartment();
    }
}
